package com.yaolonga.itfc.manager.core;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: yaolong
 * @CreateTime: 2024-10-16  17:17
 * @Description: 以太网网卡信息
 * @Version: 1.0
 */
@Data
@Slf4j
public class NetworkInterfaceInfo{
    private boolean dhcp;
    private int mtu;
    private String dhcpServer;
    private List<NetworkAddress> ip = new ArrayList<>();
    private String mac;
    private String mask;
    private String gateway;
    private List<NetworkAddress> dns = new ArrayList<>();
    private List<NetworkAddress> ipv6 = new ArrayList<>();
    /**
     * 描述信息
     */
    private String description;
    private String name;
    private boolean state = true;

    private String id;

    /**
     * conf id
     */
    private String confId;
    /**
     * 配置名称
     */
    private String confName;

    private InterfaceType type;
    /**
     * 网卡索引
     */
    private int ifIndex;
    /**
     * 路由信息
     */
    private List<NetRoute> routes = new ArrayList<>();


    public void addIp(NetworkAddress ip) {
        this.ip.add(ip);
    }
    public void addIpV6(NetworkAddress ipv6) {
        this.ipv6.add(ipv6);
    }

    public void addDns(NetworkAddress dns) {
        this.dns.add(dns);
    }

    public void addRoute(NetRoute route) {
        this.routes.add(route);
    }
}
